package com.example.project_board.controller;

import com.example.project_board.mapper.SuggestionMapper;
import com.example.project_board.model.Suggestion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collections;
import java.util.List;
import java.util.Map;

@Controller
public class Meg {
    @Autowired
    private SuggestionMapper suggestionMapper;
    @GetMapping("/suggestionMge.html")
    public String visitor(Model m, @RequestParam Map<String, Object> params){
        // 查询所有
//        List<T> list();
        List<Suggestion> arrayList = suggestionMapper.selectSuggestion();
        m.addAttribute("show_suggestion",arrayList);//将arrayList隐藏到visitor_list中
//        Collections.shuffle(arrayList);
        return "suggestionMge";
    }

}
